473,467 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

saving current page in .mht format using execCommand

theGeek
11 New Member
Hi All,

I want to save the current page using javascript(in asp.net). Though I could find out that the "execCommand" can do that but the only options for file types that are available in the save as dialog include .htm,.html and .txt.

My problem here is how can I save the current page in .mht format using the same command?

Is this possible? If not how can I do that?

Please help!!!!!!!!!!!
Oct 30 '07 #1
5 4627
acoder
16,027 Recognized Expert Moderator MVP
I don't think it's possible using execCommand. It's also not JavaScript, but proprietary JScript.

You can save in .mht format from the File..Save As... menu.
Oct 31 '07 #2
theGeek
11 New Member
I don't think it's possible using execCommand. It's also not JavaScript, but proprietary JScript.

You can save in .mht format from the File..Save As... menu.
Hi acoder,

Thanks for replying!

Is there any other way of saving the page in .mht(or just any supported format) using javascript, C# or any other language?

Cuz I would want to place a link on the page that opens in a popup window with all menus and bars disabled and that saves the page to user's disk.

Also, you said earlier "It's also not JavaScript, but proprietary JScript". Could you please explain that? Did you mean execCommand is not javascript and it is JScript?

Hoping for a positive reply(or atleast a ref :) )!!!
Thanks!!!
Nov 1 '07 #3
rajivranjantcs
1 New Member
Even I'm looking for the same. Can we save the file as mht to retain the css formatting after saving...... Or is there any other means of acheiving it.....
Nov 29 '07 #4
acoder
16,027 Recognized Expert Moderator MVP
Is there any other way of saving the page in .mht(or just any supported format) using javascript, C# or any other language?
Not with JavaScript, but you could try VB.
Also, you said earlier "It's also not JavaScript, but proprietary JScript". Could you please explain that? Did you mean execCommand is not javascript and it is JScript?
execCommand is supported by other browsers too, but not execCommand("saveas"...).
Nov 30 '07 #5
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN!
Even I'm looking for the same. Can we save the file as mht to retain the css formatting after saving...... Or is there any other means of acheiving it.....
This won't be possible with JavaScript. You could try an ActiveX/vbscript solution.
Nov 30 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Kevin Ingram | last post by:
Ok, this is probably a silly question but I just keep hitting a brick wall here. I usually develop my sites entirely in ASP and use a database for data storage, works great for me. I also...
3
by: lir | last post by:
Hi, I am trying to save a fram in a page using the execCommand("saveas") the html is save currectly but I can not save the gif on that page. How can I save the fram with the gif via...
5
by: Rami A. Kishek | last post by:
I'm new to js. Please help me figure this out WANT: Client to save an image to disk pressing a "download" button. The image name is dynamic, from JS code on another part of the page DID: Read...
1
by: anonieko | last post by:
> Use x = window.Open(...) x.document.write( yourhtml) > How to print from javascript using .print > How to use ContentWindow > > How t use getElementById > How to get HTML of document...
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
2
by: =?Utf-8?B?Um9iZXJ0SGlsbEVEUw==?= | last post by:
I have classic asp files (IIS6) that need to be saved in UTF-8 format. I save a file with Notepad using SAVE-AS & UTF-8 format. If I reopen the file using Notepad and bring up the save-as dialog...
4
mehj123
by: mehj123 | last post by:
Hi, I want to save data in a html table in the .csv format. I am able to save the data in a normal text file by using the command <button...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.